package com.aaa.system.dao;

import com.aaa.common.pojo.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @program: education-parent
 * @description:
 * @author: 闫克起
 * @create: 2023-05-22 16:23
 **/
public interface RoleDao extends BaseMapper<Role> {
    @Select(value = "select r.* from acl_role r join acl_user_role ur on r.id=ur.role_id where ur.user_id=#{userId}")
    List<Role> selectByUserId(String userId);

    @Delete(value = "delete from acl_user_role where user_id=#{userId}")
    void deleteByUserId(String userId);
}
